"in the following cell, override the default pipeline parameters if needed"# QC ParamsCONCAT_SAMPLES: bool=True# Concatenate all samples in one object, default: trueCORRECT_AMBIENT_RNA: bool= (False# Correct ambient RNA, uses DecontX, Currently causes multiple erros.)FILTER_DOUBLETS: bool=False# Filter doublets using ScrubletCELL_CYCLE_SCORE: bool= (True# Calculate cell cycle scores, based on scanpy implementation.)# TODO: Move to normalization# VARS_TO_REGRESS: List[str] = [] # list of regress (pct_counts_mt, pct_counts_ribo).# REGRESS: bool = False # Regress out unwanted variables. Not recommended.################################################################################ QC Dict ##################################################################################"""Can either be a flat-dict for global threshold or a dict of dicts for each sample Entries in the form of col_name: [low, high] Ex: 'pct_counts_mt':[0, 20] which will be used as (low, high) pair.Also entries can be a single number Ex: 'pct_counts_mt': 3 which be used as number of MADS as follows media -+ nmad * MAD. """# by default, filtering on read counts, number of features, and mitochondrial contentqc_dict: Dict[str, List] | Dict[str, Number] = {"n_genes_by_counts": 5,"total_counts": 5,"pct_counts_mt": 3,}# MODIFY_ME, Specifiy only after running diagnotics on the samples# global config# qc_dict: Dict[str, List] | Dict[str, List] = {# "pct_counts_mt": [0, 10],# "pct_counts_rb": [0, 10],# "n_genes_by_counts": [1500, 9000],# "total_counts": [3_000, 40_000]# }# # per-sample config# qc_dict: Dict[str, List] | Dict[str, List] = {# "sample1": {# "pct_counts_mt": [0, 10],# "pct_counts_rb": [0, 10],# "total_counts": [3_000, 40_000]# },# "sample2": {# "pct_counts_rb": [0, 10],# "n_genes_by_counts": [1500, 9000],# "total_counts": [3_000, 40_000]# },# "sample3": {# "pct_counts_mt": [0, 10],# "n_genes_by_counts": [1500, 9000],# "total_counts": [3_000, 40_000]# },# "sample4": {# "pct_counts_mt": [0, 10],# "pct_counts_rb": [0, 10],# "n_genes_by_counts": [1500, 9000],# }# }
# #| echo: false# #| output: false# #| warning: false# ## Regression of Variables# # - [ ] Add error handling if the vars to regress is empty or contain non-keys# if REGRESS:# sc.pp.regress_out(adata, keys= VARS_TO_REGRESS)